]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Stop watching FolderIcon parent view when destroyed
authorRay Strode <rstrode@redhat.com>
Thu, 18 Jul 2019 18:49:30 +0000 (14:49 -0400)
committerRay Strode <halfline@gmail.com>
Tue, 23 Jul 2019 14:53:24 +0000 (14:53 +0000)
When a FolderIcon is opened, it asks the parent view to allocate
space for it, which takes time.  Eventually, the space-ready
signal is emitted on the view and the icon can make use of the new
space with its popup.  If the icon gets destroyed in the
interim, though, space-ready signal handler still fires.

This commit disconnects the signal handler so it doesn't get called
on a destroyed icon.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/628

js/ui/appDisplay.js

index 60e84d73e50e41be6071ddbf433848323c087e73..d361ec16c133a1417033d597350a9b08e2e02d97 100644 (file)
@@ -1155,6 +1155,11 @@ var FolderIcon = class FolderIcon {
     onDestroy() {
         this.view.actor.destroy();
 
+        if (this._spaceReadySignalId) {
+            this._parentView.disconnect(this._spaceReadySignalId);
+            this._spaceReadySignalId = 0;
+        }
+
         if (this._popup)
             this._popup.actor.destroy();
     }
@@ -1226,8 +1231,9 @@ var FolderIcon = class FolderIcon {
     }
 
     _openSpaceForPopup() {
-        let id = this._parentView.connect('space-ready', () => {
-            this._parentView.disconnect(id);
+        this._spaceReadySignalId = this._parentView.connect('space-ready', () => {
+            this._parentView.disconnect(this._spaceReadySignalId);
+            this._spaceReadySignalId = 0;
             this._popup.popup();
             this._updatePopupPosition();
         });